﻿using System;
using System.Linq;

namespace MyHome.Server.PluginBase
{
    /// <summary>
    /// A plugin that inputs data into the system.
    /// This can be some self generated data or data from an external system such as a camera or a KNX lightswitch.
    /// </summary>
    /// <typeparam name="T">The type of data generated from this plugin</typeparam>
    public interface IInputPlugin<T> : IPlugin
    {
        /// <summary>
        /// Occurs when new input data is available.
        /// </summary>
        event EventHandler<ValueChangedEventArgs<T>> InputChanged;

        /// <summary>
        /// Gets the last value of data that was generated by this plugin.
        /// </summary>
        /// <value>
        /// The last value.
        /// </value>
        T LastValue { get; }
    }
}